package tests.user;
import tester.*;
import tester.utilities.Printer;

public class Number {
	double value;
	
	Number(double value) {
		this.value = value;
	}

	public boolean containsVar() {
		return false;
	}
	
	public String toString() {
		return "" + this.value;
	}
	
	public String toSmartString() {
	   if (this.value == Math.round(this.value)) {
	      return "" + (int) this.value;
	   } else {
	      return "" + this.value;
	   }
	}
	
	public boolean equals(Number that) {
		return this.value == that.value;
	}
	
	public boolean equals(Object o) {
		if (o instanceof Number) {
			return this.equals((Number) o);
		} else {
			return false;
		}
	}
}

class ExamplesNumber{
	public ExamplesNumber(){}
	
	
	public void testNum(Tester t){
		Number n8 = new Number(8.0);
		Number n8a = new Number(8.0);
		t.checkExpect(n8, n8a);
		t.checkExpect(new Number(8.0), new Number(8));
	}
	
	public static void main(String[] argv){
		ExamplesNumber e = new ExamplesNumber();
		Printer.print(e);
		System.out.println("Tester starting");
		Tester.runReport(e, true, true);
	}
}
